package com.example.springboot.mapper;

import com.example.springboot.dto.CommentDTO;
import com.example.springboot.entity.ForumComment;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ForumCommentMapper {

    void insertComment(ForumComment comment);

    ForumComment selectCommentById(Integer commentId);

    List<ForumComment> selectCommentsByPostId(Integer postId);

    void updateComment(ForumComment comment);

    void deleteComment(Integer commentId);

    CommentDTO getCommentWithUserInfo(Integer commentId);

    List<ForumComment> selectCommentsByUserId(@Param("userId") Integer userId);

    Page<ForumComment> findAllComments();

    Page<ForumComment> findByQuery(String query);

    void delete(Integer commentId);

    String findRoleByUsername(String username);
}